Skip to content

Matter Sensor: Add modular profile supports for AQS #2082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

ctowns
Copy link
Contributor

@ctowns ctowns commented Apr 18, 2025

Check all that apply

Type of Change

  • WWST Certification Request
    • If this is your first time contributing code:
      • I have reviewed the README.md file
      • I have reviewed the CODE_OF_CONDUCT.md file
      • I have signed the CLA
    • I plan on entering a WWST Certification Request or have entered a request through the WWST Certification console at developer.smartthings.com
  • Bug fix
  • New feature
  • Refactor

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have verified my changes by testing with a device or have communicated a plan for testing
  • I am adding new behavior, such as adding a sub-driver, and have added and run new unit tests to cover the new behavior

Description of Change

Summary of Completed Tests

Copy link

Duplicate profile check: Passed - no duplicate profiles detected.

Copy link

Copy link

github-actions bot commented Apr 18, 2025

Test Results

   67 files    435 suites   0s ⏱️
2 239 tests 2 239 ✅ 0 💤 0 ❌
3 822 runs  3 822 ✅ 0 💤 0 ❌

Results for commit 632d75c.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Apr 18, 2025

File Coverage
All files 85%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/bosch-button-contact/init.lua 44%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/init.lua 91%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/air-quality-sensor/init.lua 93%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/smoke-co-alarm/init.lua 85%
/home/runner/work/SmartThingsEdgeDrivers/SmartThingsEdgeDrivers/drivers/SmartThings/matter-sensor/src/embedded-cluster-utils.lua 45%

Minimum allowed coverage is 90%

Generated by 🐒 cobertura-action against 632d75c

@ctowns ctowns force-pushed the modular-profiles-matter-sensor branch 2 times, most recently from 271a839 to 83f4407 Compare April 18, 2025 17:20
@ctowns ctowns force-pushed the modular-profiles-matter-sensor branch from 83f4407 to 91e95e5 Compare April 18, 2025 22:19
@ctowns ctowns force-pushed the modular-profiles-matter-sensor branch 3 times, most recently from da8c20f to 6a42641 Compare May 14, 2025 19:56
@ctowns ctowns force-pushed the modular-profiles-matter-sensor branch from 6a42641 to ecf0a67 Compare May 14, 2025 20:00
@ctowns ctowns force-pushed the modular-profiles-matter-sensor branch from ffd6bb3 to c08a758 Compare May 14, 2025 21:23
match_modular_profile(driver, device)
else
match_profile_switch(driver, device)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit there's a extra line here

end

local function do_configure(driver, device)
-- we have to read the unit before reports of values will do anything
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
-- we have to read the unit before reports of values will do anything
-- we have to read the unit before reports of values will do anything

version: 1
categories:
- name: AirQualityDetector
preferences:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might need two versions of this profile, one without the preferences, since temperatureMeasurement and relativeHumidityMeasurement are optional

local matter_air_quality_sensor_handler = {
NAME = "matter-air-quality-sensor",
lifecycle_handlers = {
init = device_init,
doConfigure = do_configure
doConfigure = do_configure,
infoChanged = info_changed,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we implement a driverSwitched handler and call match_modular_profile from it?


local clusters = require "st.matter.clusters"

clusters.AirQuality = require "AirQuality"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason you're testing with the embedded clusters rather than from the lua libs?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants